package com.ssy.lingxi.platform.manage.repository;


import com.ssy.lingxi.platform.manage.entity.content.ContentInformationCollect;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface ContentInformationCollectRepository extends JpaRepository<ContentInformationCollect, Long>, JpaSpecificationExecutor<ContentInformationCollect> {

    void deleteByInformationIdAndMemberIdAndUserId(Long informationId, Long memberId, Long userId);

    Boolean existsByInformationIdAndMemberIdAndUserId(Long informationId, Long memberId, Long userId);

    void deleteByInformationId(Long id);

    void deleteByInformationIdIn(List<Long> idList);

    Page<ContentInformationCollect> findAllByMemberIdAndUserId(Long memberId, Long userId, Pageable page);
}
